package com.jike.noobmoney.net;

import com.jike.noobmoney.entity.AboutUsEntity;
import com.jike.noobmoney.entity.BaseEntity;
import com.jike.noobmoney.entity.ImageEntity;
import com.jike.noobmoney.entity.LoginUserEntity;
import com.jike.noobmoney.entity.MoneyEntity;
import com.jike.noobmoney.entity.MyTaskEntity;
import com.jike.noobmoney.entity.QuestionEntity;
import com.jike.noobmoney.entity.RegistEntity;
import com.jike.noobmoney.entity.ShouZhiEntity;
import com.jike.noobmoney.entity.SmsEntity;
import com.jike.noobmoney.entity.SubmitOrderDetailEntity;
import com.jike.noobmoney.entity.TaskDetailEntity;
import com.jike.noobmoney.entity.TaskListEntity;
import com.jike.noobmoney.entity.TuiJianEntity;
import com.jike.noobmoney.entity.UserInfoEntity;
import com.jike.noobmoney.entity.VersionEntity;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

public interface APIService {

    /**
     * 获取验证码
     */
    @FormUrlEncoded
    @POST("renwu/smscodeapi")
    Call<SmsEntity> getCode(
            @Field("mobile") String mobile
    );

    /**
     * 注册
     */
    @FormUrlEncoded
    @POST("renwu/userregisterapi")
    Call<RegistEntity> regist(
            @Field("mobile") String mobile,
            @Field("password") String password,
            @Field("msgcode") String msgcode,
            @Field("refercode") String refercode
    );

    /**
     * 登录
     */
    @FormUrlEncoded
    @POST("renwu/userloginapi")
    Call<LoginUserEntity> login(
            @Field("mobile") String mobile,
            @Field("password") String password
    );
    /**
     * 兑换
     */
    @FormUrlEncoded
    @POST("renwu/exchangeapi")
    Call<BaseEntity> push(
            @Field("u_id") String u_id,
            @Field("codestr") String  codestr
    );

    /**
     * 忘记密码
     */
    @FormUrlEncoded
    @POST("renwu/passwordeditapi")
    Call<RegistEntity> forgotpassword(
            @Field("mobile") String mobile,
            @Field("password") String password,
            @Field("msgcode") String sms
    );

    /**
     * 修改密码，根据密码
     */
    @FormUrlEncoded
    @POST("renwu/passwordeditbyoldpwapi")
    Call<RegistEntity> updatepassword(
            @Field("u_id") String u_id,
            @Field("oldpassword") String oldpassword,
            @Field("password") String password,
             @Field("password2") String password2
    );

    /**
     * 用户信息
     */
    @FormUrlEncoded
    @POST("renwu/userinfoapi")
    Call<UserInfoEntity> getUserInfo(
            @Field("u_id") String u_id
    );

    /**
     * 版本信息
     */
    @FormUrlEncoded
    @POST("renwu/versionapi")
    Call<VersionEntity> getVersionDetail(
            @Field("versionnumber") String version
    );

    /**
     * 任务分类
     */
    @POST("renwu/catelist")
    Call<RegistEntity> getCateList();

    /**
     * 任务列表
     */
    @FormUrlEncoded
    @POST("renwu/tasklistapi")
    Call<TaskListEntity> getTaskList(
            @Field("c_id") String c_id,
            @Field("page") String page,
            @Field("pagesize") String pagesize
    );


    /**
     * 任务详情
     */
    @FormUrlEncoded
    @POST("renwu/taskinfoapi")
    Call<TaskDetailEntity> getTaskDetail(
            @Field("u_id") String u_id,
            @Field("t_id") String t_id
    );

    /**
     * 领取任务
     */
    @FormUrlEncoded
    @POST("renwu/addorderapi")
    Call<BaseEntity> getTaskOrder(
            @Field("u_id") String u_id,
            @Field("t_id") String t_id
    );
    /**
     * 兑换码
     */
    @FormUrlEncoded
    @POST("renwu/exchangeapi")
    Call<BaseEntity> pushCode(
            @Field("u_id") String u_id,
            @Field("codestr") String codestr
    );


    /**
     * 关于我们 商务合作
     */
    @POST("renwu/about")
    Call<AboutUsEntity> getAboutUs();

    /**
     * 常见问题
     */
    @POST("renwu/questionapi")
    Call<QuestionEntity> getQuestion();


    /**
     * 我的任务
     */
    @FormUrlEncoded
    @POST("renwu/orderlistapi")
    Call<MyTaskEntity> getMyTask(
            @Field("u_id") String u_id,
            @Field("status") String status
    );

    /**
     * 提现
     */
    @FormUrlEncoded
    @POST("renwu/tixian")
    Call<BaseEntity> getTiXian(
            @Field("u_id") String u_id,
            @Field("account") String account,
            @Field("name") String name,
            @Field("money") String money
    );


    /**
     * 收支明细
     */
    @FormUrlEncoded
    @POST("renwu/usermoneyapi")
    Call<ShouZhiEntity> getShouZhi(
            @Field("u_id") String u_id,
            @Field("type") String type,
            @Field("page") String page,
            @Field("pagesize") String pagesize
    );

    /**
     * 收支明细
     */
    @FormUrlEncoded
    @POST("renwu/userrwmoneyapi")
    Call<ShouZhiEntity> TaskMoneyList(
            @Field("u_id") String u_id,
            @Field("type") String type,
            @Field("page") String page,
            @Field("pagesize") String pagesize
    );


    /**
     * 编辑个人信息1
     */
    @FormUrlEncoded
    @POST("renwu/useredit")
    Call<BaseEntity> editUserInfo1(
            @Field("u_id") String u_id,
            @Field("nick") String nick,
            @Field("gender") String gender,
            @Field("birthday") String birthday
    );

    /**
     * 编辑信息2
     */
    @FormUrlEncoded
    @POST("renwu/useredit")
    Call<BaseEntity> editUserInfo2(
            @Field("u_id") String u_id,
            @Field("avatar") String avatar,
            @Field("nick") String nick,
            @Field("gender") String gender,
            @Field("birthday") String birthday
    );

    /**
     * 提交任务
     */
    @FormUrlEncoded
    @POST("renwu/submitorderapi")
    Call<BaseEntity> submitOrder(
            @Field("u_id") String u_id,
            @Field("o_id") String o_id,
            @Field("info") String info,
            @Field("picstr") String picstr,
            @Field("sign") String sign
    );

    /**
     * 提交任务新版
     */
    @FormUrlEncoded
    @POST("renwu/submitorder2")
    Call<BaseEntity> submitOrderNew(
            @Field("u_id") String u_id,
            @Field("o_id") String o_id,
            @Field("info") String info,
            @Field("picstr") String picstr
    );




    /**
     * 取消任务
     */
    @FormUrlEncoded
    @POST("renwu/cancelorderapi")
    Call<BaseEntity> cancelOrder(
            @Field("u_id") String u_id,
            @Field("o_id") String o_id
    );


    /**
     * 已提交任务详情
     */
    @FormUrlEncoded
    @POST("renwu/orderinfoapi")
    Call<SubmitOrderDetailEntity> submitOrderDetail(
            @Field("o_id") String o_id
    );

    /**
     * 用户余额
     */
    @FormUrlEncoded
    @POST("renwu/moneyview")
    Call<MoneyEntity> moneyView(
            @Field("u_id") String u_id
    );

    /**
     * 用户申述提交
     */
    @FormUrlEncoded
    @POST("renwu/appealaddapi")
    Call<BaseEntity> setAppeal(
            @Field("u_id") String u_id,
            @Field("o_id") String o_id,
            @Field("text") String text
    );

    /**
     * 今日邀请收益
     */
    @FormUrlEncoded
    @POST("renwu/inviteincomeapi")
    Call<TuiJianEntity> getincome(
            @Field("u_id") String u_id
    );

    /**
     * 获取二维码
     */
    @FormUrlEncoded
    @POST("renwu/createxbqrcodeapi")
    Call<ImageEntity> getQrCode(
            @Field("u_id") String u_id
    );

}